import {request} from "../../request"

export function huoqu(loginData) {
    console.log(loginData.pagenum,loginData.pagesize);
  return request({
    url: '/users',
    method: 'get',
    params:{...loginData}
  })
}

export function loginRequest(loginData) {
  return request({
    url: '/users',
    method: 'post',
    data: {
      username: loginData.username,
      password: loginData.password
    }
  })
}
export function shanchu(loginData) {
  return request({
    url: '/users'+'/'+loginData,
    method:'delete'
  })
}

export function bjyhrequest(loginData) {
  console.log(loginData);
  return request({
    url: '/users'+'/'+loginData.id,
    method:'put',
    data:{
        email: loginData.email,
        mobile:loginData.mobile,
    },
  })
}
export function xgjsrequest(loginData) {
  console.log(loginData);
  return request({
    url: '/users'+'/'+loginData.id+'/role',
    method:'put',
    data:{
        email: loginData.email,
        mobile:loginData.mobile,
        rid:loginData.rid
    },
  })
}

export function yhzt(loginData) {
  console.log(loginData);
  return request({
    url: '/users'+'/'+loginData.uid+'/state'+'/'+loginData.type,
    method:'put',
  })
}